package com.xyyl.patient.service.common;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.xyyl.patient.entity.base.Token;
import com.xyyl.patient.mapper.user.AccessTokenMapper;
import com.xyyl.patient.service.base.EasemobService;

/**
 * @projectName:xyyl-patient-service
 * @ClassName: EasemobServiceImpl
 * @Description: 环信授权信息service
 * @author chen
 * @date 2017年11月24日
 *
 */
@Service("easemobService")
public class EasemobServiceImpl    implements EasemobService{
 
	@Autowired
	private AccessTokenMapper tokenMapper;
	
	
	@Override
	public Token getToken(Integer id) {
		return tokenMapper.selectOne(id);
	}

	@Override
	public void updateToken(Token token) {
		if(token.getId()!=null){
		   tokenMapper.update(token);	
		}else{
		   tokenMapper.insert(token);
		}
	}

}
